﻿Public Class KisaVadeli

	Class Hastalik

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.isyerino, i.isyeriadi, s.hmurtar, s.dosyaacik,")
			Q("hastalik, case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from shasgenel s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("left join isyerigenel i on s.isyerino = i.isyerino")
			Q("where s.hmurtar between :tarih1 and :tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Analik

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.isyerino, i.isyeriadi, s.gebmurtar, s.dogmurtar, s.emzmurtar, s.dosyaacik,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from sanalik s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("left join isyerigenel i on s.isyerino = i.isyerino")
			Q("where (s.gebmurtar between @d1 and @d2 or s.dogmurtar between @d1 and @d2 or s.emzmurtar between @d1 and @d2)")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Iskazasi

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.isyerino, i.isyeriadi, s.hmurtar, s.dosyaacik,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from siskgenel s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("left join isyerigenel i on s.isyerino = i.isyerino")
			Q("where s.hmurtar between :tarih1 and :tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Issizlik

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.isyerino, s.isyeriadi, s.murtar, s.dosyaacik,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from siszgenel s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("where s.murtar between :tarih1 and :tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Ilac

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.murtar,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from silac s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("where s.murtar between :tarih1 and :tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Gozluk

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.murtar,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from sgozluk s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("where s.murtar between @tarih1 and @tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

	Class Evlenme

		Shared Function DosyaListesi(ByVal Process As Token, ByVal tarih1 As Date, ByVal tarih2 As Date) As Recordset
			Q("select s.dosyano, s.kimlik, s.sno, rtrim(g.adi) + ' ' + rtrim(g.soyadi) as adi, s.murtar,")
			Q("case when len(ltrim(s.sno)) >= 9 then 'SGY' else 'SSY' end as yasa")
			Q("from sevlenme s inner join sgenel g on s.kimlik = g.kimlik and s.sno = g.sno")
			Q("where s.murtar between @tarih1 and @tarih2")
			Q("order by s.dosyano")
			Return Process.OpenSQL("*", tarih1, tarih2)
		End Function

	End Class

End Class
